package com.boe.hbd.server.servlet;

import java.util.List;

import com.boe.hbd.server.cache.PicSeqCache;
import com.boe.hbd.server.cache.ViewCache;
import com.boe.hbd.server.dao.PicDao;
import com.boe.hbd.server.dao.ViewDao;
import com.boe.hbd.server.model.View;

public class InitCache {

	public static void initViewCache() {
		List<View> l = ViewDao.getInstance().findAll();
		ViewCache vc = ViewCache.getInstance();
		for (View v : l) {
			vc.put(v.getName(), v);
		}
	}

	public static void initPicSeqCache() {
		int currentSeq = PicDao.getInstance().findMaxSeq();
		PicSeqCache.getInstance().init(currentSeq);
	}
}
